<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动画</title>
    <style>
        /*过度效果*/
        .xyz-enter-active, .xyz-leave-active{
            transition: opacity 1s;
        }
        /*隐藏时的样式*/
        .xyz-enter, .xyz-leave-to{
            opacity: 0;
        }
    </style>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="demo">
        <button @click="isShow=!isShow">toggle</button>
        <transition name="xyz">
            <p v-show="isShow">hello</p>
        </transition>
    </div>
    <script>
        new Vue({
            el: '#demo',
            data: {
                isShow: true
            }
        });
    </script>
</body>
</html>